{% if wts.pos or wts.neg or wts.neg_remaining or wts.pos_remaining %}
    {% if not in_horizontal_layout %}
        <p style="margin-bottom: 0.5em; margin-top: 0em">
            {% include "target_header.html" with context %}
        </p>
    {% endif %}
    <table class="eli5-weights"
           style="{{ target_table_styles }}{% if in_horizontal_layout %} width: 100%;{% else %} margin-bottom: 2em;{% endif %}">
        <thead>
        <tr style="{{ tr_styles }}">
            {% if explaining_prediction %}
                <th style="{{ td1_styles }}" title="{{ contribution_help }}">
                    Contribution<sup>?</sup>
                </th>
            {% else %}
                <th style="{{ td1_styles }}" title="{{ weight_help }}">
                    Weight<sup>?</sup>
                </th>
            {% endif %}
            <th style="{{ td2_styles }}">Feature</th>
            {% if show_feature_values %}
                <th style="{{ td3_styles }}">Value</th>
            {% endif %}
        </tr>
        </thead>
        <tbody>
        {% for fw in wts.pos %}
            {% include "weights_table_row.html" with context %}
        {% endfor %}
        {% if wts.pos_remaining %}
            <tr style="background-color: {{ wts.pos|remaining_weight_color(w_range, 'pos') }}; {{ tr_styles }}">
                <td colspan="{{ weights_table_span }}" style="{{ tdm_styles }}">
                    <i>&hellip; {{ wts.pos_remaining }} more positive &hellip;</i>
                </td>
            </tr>
        {% endif %}

        {% if wts.neg_remaining %}
            <tr style="background-color: {{ wts.neg|remaining_weight_color(w_range, 'neg') }}; {{ tr_styles }}">
                <td colspan="{{ weights_table_span }}" style="{{ tdm_styles }}">
                    <i>&hellip; {{ wts.neg_remaining }} more negative &hellip;</i>
                </td>
            </tr>
        {% endif %}
        {% for fw in wts.neg|reverse %}
            {% include "weights_table_row.html" with context %}
        {% endfor %}

        </tbody>
    </table>
{% endif %}
